﻿using DevComponents.DotNetBar;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace shopsoft.main.AppCommon
{
    /// <summary>
    /// 客户端参数设置集
    /// </summary>
    public static class ClientParameterSettings
    {
        #region Static Readonly Parameter

        /// <summary>
        /// 图片文件过滤格式字符串
        /// </summary>
        public static readonly string ImageFileFilter = "JPEG (*.jpg;*.jpeg)|*.jpg;*.jpeg|BMP (*.bmp)|*.bmp|PNG (*.png)|*.png|所有图像文件 (*.jpg;*.jpeg;*.bmp;*.png)|*.jpg;*.jpeg;*.bmp;*.png";
        /// <summary>
        /// Excel文件过滤格式字符串
        /// </summary>
        public static readonly string ExcelFileFilter = "Excel文件 (*.xls)|*.xls";
        /// <summary>
        /// SuperToolTip颜色方案
        /// </summary>
        public static eTooltipColor SuperToolTipColor = eTooltipColor.Office2003;
        /// <summary>
        /// SuperToolTip中仅显示图片时的边框宽度
        /// </summary>
        public static readonly int SuperToolTipSingleImageBorderWidth = 15;
        /// <summary>
        /// 暂无图片
        /// </summary>
        public static readonly Image NullImage = Properties.Resources.noPic;
        /// <summary>
        /// 无效日期时间
        /// </summary>
        public static readonly DateTime InvalidDateTime = Convert.ToDateTime("0001/1/1 0:00:00");
        /// <summary>
        /// 透明色
        /// </summary>
        public static readonly Color TransparentColor = Color.FromArgb(0);
        /// <summary>
        /// 标准（正常）信息的背景色
        /// </summary>
        public static readonly Color NormalBackgroundColor = Color.Empty;
        /// <summary>
        /// 无效ID
        /// </summary>
        public static readonly int InvalidID = -1;
        ///// <summary>
        ///// Loadin Flash的物理路径
        ///// </summary>
        ///// <remarks>\Plugin\Elike.Flash.Loading\Loading_Cn.swf</remarks>
        //public static readonly string LoadingFlashPath =
        //    string.Format(@"{0}\Plugin\Elike.Flash.Loading\Loading_{1}n.swf",
        //    Application.StartupPath, Language.LanguageType == LanguageType.English ? "E" : "C");

        /// <summary>
        /// LoadingFlash图片
        /// </summary>
        //public static readonly Image LoadingFlash =
        //    Language.LanguageType == LanguageType.English ? Properties.Resources.LoadingEn : Properties.Resources.LoadingCn;
        public static readonly Image LoadingFlash = Properties.Resources.LoadingCn;

        #endregion Static Readonly Parameter

        #region Static Can Setting Parameter

        /// <summary>
        /// 已被删除项前景色
        /// </summary>
        public static Color DeleledItemForeColor = Color.DimGray;
        /// <summary>
        /// 预警项的前景色
        /// </summary>
        public static Color WarningItemForeColor = Color.Red;
        /// <summary>
        /// 验证错误的信息的背景色
        /// </summary>
        public static Color ErrorBackgroundColor = Color.Red;
        /// <summary>
        /// 检验策略调整次数改变的颜色
        /// </summary>
        public static Color ChangeTimesColor = Color.DarkSeaGreen;
        /// <summary>
        /// 空操作按钮的显示文本
        /// </summary>
        public static string NullOperationButtonText = "-";
        /// <summary>
        /// 空文本
        /// </summary>
        public static string NullText = "/";
        /// <summary>
        /// 范围
        /// </summary>
        public static string BetweenText = "~";
        /// <summary>
        /// 历史年限（单位年、生产图表区间）
        /// </summary>
        public static int HistoryYear = 6;
        /// <summary>
        /// 历史月限（海管综合表的工况信息默认时间段）
        /// </summary>
        public static int HistoryMonth = 1;
        /// <summary>
        /// 文本连接符
        /// </summary>
        public static string TextConnector = "-";
        /// <summary>
        /// 默认每页数据数量
        /// </summary>
        public static int DefaultPageSize = 20;

        #region  CorrsionLevelColor
        /// <summary>
        /// 挂片腐蚀等级:无
        /// </summary>
        public static Color CouponCorrosionLevelColorNone = Color.BlueViolet;
        /// <summary>
        /// 挂片腐蚀等级:轻度
        /// </summary>
        public static Color CouponCorrosionLevelColorMild = Color.Black;
        /// <summary>
        /// 挂片腐蚀等级:中度
        /// </summary>
        public static Color CouponCorrosionLevelColorModerate = Color.Orange;
        /// <summary>
        /// 挂片腐蚀等级:高度
        /// </summary>
        public static Color CouponCorrosionLevelColorAltitude = Color.Red;
        /// <summary>
        /// 挂片腐蚀等级:严重
        /// </summary>
        public static Color CouponCorrosionLevelColorSerious = Color.Purple;
        /// <summary>
        /// 设施预警等级一级
        /// </summary>
        public static Color EquipFirstLevelWarning = ColorTranslator.FromHtml("#FF34B3");   //#FFE1FF
        /// <summary>
        /// 设施预警等级二级
        /// </summary>
        public static Color EquipSecondLevelWarning = ColorTranslator.FromHtml("#FF44B3");   //#FFBBFF
        /// <summary>
        /// 设施预警等级三级
        /// </summary>
        public static Color EquipThirdLevelWarning = ColorTranslator.FromHtml("#FF54B3");   //#FF83FA
        /// <summary>
        /// 设施预警等级四级
        /// </summary>
        public static Color EquipFourthLevelWarning = ColorTranslator.FromHtml("#FF64B3");  //#FF00FF
        /// <summary>
        /// 设施预警等级五级
        /// </summary>
        public static Color EquipFifthLevelWarning = ColorTranslator.FromHtml("#FF74B3");   //#FF34B3
        /// <summary>
        /// 管道预警等级一级
        /// </summary>
        public static Color PipingFirstLevelWarning = ColorTranslator.FromHtml("#FF84B3");
        /// <summary>
        /// 管道预警等级二级
        /// </summary>
        public static Color PipingSecondLevelWarning = ColorTranslator.FromHtml("#FF94B3");
        /// <summary>
        /// 管道预警等级三级
        /// </summary>
        public static Color PipingThirdLevelWarning = ColorTranslator.FromHtml("#FFA4B3");
        #endregion CorrsionLevelColor

        #region Format the Name
        /// <summary>
        /// FlowChart路径
        /// </summary>
        public static string FlowChartPath = System.Windows.Forms.Application.StartupPath + "\\FlowChart\\";
        /// <summary>
        /// 平台命名格式
        /// </summary>
        public static string PlatNamePrefix = "PL_";
        /// <summary>
        /// 流程命名格式
        /// </summary>
        public static string ProcessNamePrefix = "PR_";
        /// <summary>
        /// 作业区命名格式
        /// </summary>
        public static string BaseAreaNamePrefix = "BA_";
        /// <summary>
        /// 设备命名格式
        /// </summary>
        public static string EquipNamePrefix = "E_";
        /// <summary>
        /// 管道命名格式
        /// </summary>
        public static string PipingNamePrefix = "P_";
        /// <summary>
        /// 油井命名格式
        /// </summary>
        public static string WellNamePrefix = "W_";
        /// <summary>
        /// 海管命名格式
        /// </summary>
        public static string SeaPipingNamePrefix = "SP_";
        /// <summary>
        /// 平台结构命名格式
        /// </summary>
        public static string PlatStructureNamePrefix = "PS_";
        /// <summary>
        /// 检测点命名格式
        /// </summary>
        public static string SvlcPointNamePrefix = "M_";

        /// <summary>
        /// 挂片
        /// </summary>
        public static string SvlcCoupon = "M1_";
        /// <summary>
        /// UT
        /// </summary>
        public static string SvlcUT = "M2_";
        /// <summary>
        /// LPR
        /// </summary>
        public static string SvlcLPR = "M3_";
        /// <summary>
        /// ER
        /// </summary>
        public static string SvlcER = "M4_";
        /// <summary>
        /// 测总铁
        /// </summary>
        public static string SvlcTotalIron = "M5_";
        /// <summary>
        /// 溶解性气体
        /// </summary>
        public static string SvlcDissolvedGas = "M6_";
        /// <summary>
        /// 水分析
        /// </summary>
        public static string SvlcWaterAnalysis = "M7_";
        /// <summary>
        /// 油分析
        /// </summary>
        public static string SvlcOilAnalysis = "M8_";
        /// <summary>
        /// 气分析
        /// </summary>
        public static string SvlcGasAnalysis = "M9_";
        /// <summary>
        /// 细菌分析
        /// </summary>
        public static string SvlcBacteriaAnalysis = "M10_";
        /// <summary>
        /// 垢样分析
        /// </summary>
        public static string SvlcDepositAnalysis = "M11_";
        /// <summary>
        /// MicorCorr
        /// </summary>
        public static string SvlcMicroCorr = "M12_";
        /// <summary>
        /// 水质检测
        /// </summary>
        public static string SvlcWaterCheckAnalysis = "M13_";
        /// <summary>
        /// 海管智能通球
        /// </summary>
        public static string SvlcPipelineIntelligentPigging = "M14_";
        /// <summary>
        /// 超声波探伤
        /// </summary>
        public static string SvlcUltrasonicFlawDetection = "M15_";
        /// <summary>
        /// 磁粉探伤
        /// </summary>
        public static string SvlcMagneticFlawDetection = "M16_";
        /// <summary>
        /// X射线探伤
        /// </summary>
        public static string SvlcXrayFlawDetection = "M17_";
        /// <summary>
        /// TOFT检测
        /// </summary>
        public static string SvlcTOFTDetection = "M18_";
        /// <summary>
        /// 超声导波
        /// </summary>
        public static string SvlcUltrasonicGuidedWave = "M19_";
        /// <summary>
        /// A扫检测
        /// </summary>
        public static string SvlcAScanDetection = "M20_";
        /// <summary>
        /// B扫检测
        /// </summary>
        public static string SvlcBScanDetection = "M21_";
        /// <summary>
        /// C扫检测
        /// </summary>
        public static string SvlcCScanDetection = "M22_";
        /// <summary>
        /// 天然气全分析
        /// </summary>
        public static string SvlcGasCheckAnalysis = "M23_";

        #endregion  Format the Name

        #endregion Static Can Setting Parameter


        /// <summary>
        /// 增加根据传递的窗口设置查询字段label的名称 zp 0313
        /// </summary>
        /// <param name="MainFrm">主窗体</param>
        /// <param name="lbl">当前窗体label</param>
        public static void SetLabelText(System.Windows.Forms.Form MainFrm, DevComponents.DotNetBar.LabelX lbl)
        {
            if (MainFrm.Name == "PlatformF")
            {
                lbl.Text = "平台名称";

            }
            if (MainFrm.Name == "InspectionStrategyOfPlatF" || MainFrm.Name == "InspectionStrategyF")
            {
                lbl.Text = "描述";

            }
            if (MainFrm.Name == "PlatStructureF")
            {
                lbl.Text = "结构名称";

            }

            if (MainFrm.Name == "ProcessF")
            {
                lbl.Text = "流程名称";

            }

            if (MainFrm.Name == "EquipF")
            {
                lbl.Text = "设备名称";

            }

            if (MainFrm.Name == "EquipTypeF")
            {
                lbl.Text = "类型名称";

            }

            if (MainFrm.Name == "PipingF")
            {
                lbl.Text = "管道名称";

            }

            if (MainFrm.Name == "SvlcPointF")
            {
                lbl.Text = "检测点名称";

            }
            if (MainFrm.Name == "WellInfoF")
            {
                lbl.Text = "油井名称";

            }
            if (MainFrm.Name == "BacteriaF")
            {
                lbl.Text = "取样日期";

            }
            if (MainFrm.Name == "AnalysisF")
            {
                lbl.Text = "取样日期";

            }
            if (MainFrm.Name == "CouponF")
            {
                lbl.Text = "取出日期";

            }

            if (MainFrm.Name == "LPRF")
            {
                lbl.Text = "检测日期";

            }
            if (MainFrm.Name == "ERF")
            {
                lbl.Text = "取出日期";

            }
            if (MainFrm.Name == "MicroCorrF")
            {
                lbl.Text = "检测时间";

            }

            if (MainFrm.Name == "TotalIronF" || MainFrm.Name == "AnalysisF")
            {
                lbl.Text = "取样日期";

            }
            if (MainFrm.Name == "UTF")
            {
                lbl.Text = "取出日期";
            }
        }
    }
}
